package com.hgc.ch02.tool;

import java.util.Random;

/**
 * Created by 01367627 on 2019/7/5.
 */
public class MakeArray {

    public static final int THRESHOLD = 50;

    private MakeArray() {

    }

    public static int[] makeArray(int size) {
        if (size <= 0) {
            throw new IllegalArgumentException("size 不能小于或者等于0！");
        }
        Random random = new Random();
        int[] result = new int[size];
        for (int i = 0; i < size; i++) {
            result[i] = random.nextInt(size * 5);
        }
        return result;
    }

}
